import request from '@/utils/request';

// 查询合作商管理列表
export function listPartner(query) {
  return request({
    url: '/manage/partner/list',
    method: 'get',
    params: query
  });
}

// 查询合作商管理详细
export function getPartner(id) {
  return request({
    url: '/manage/partner/' + id,
    method: 'get'
  });
}

// 新增合作商管理
export function addPartner(data) {
  return request({
    url: '/manage/partner',
    method: 'post',
    data: data
  });
}

// 修改合作商管理
export function updatePartner(data) {
  return request({
    url: '/manage/partner',
    method: 'put',
    data: data
  });
}

// 删除合作商管理
export function delPartner(id) {
  return request({
    url: '/manage/partner/' + id,
    method: 'delete'
  });
}

//重置合作商密码
export function resetPartnerPwd(id: bigint) {
  return request({
    url: '/manage/partner/resetPwd/' + id,
    method: 'put'
  });
}

export interface Partner {
  id?: bigint;
  partnerName?: string;
  contactPerson?: string;
  contactPhone?: string;
  profitRatio?: string;
  account?: string;
  password?: string;
  createTime?: string;
  updateTime?: string;
  createBy?: string;
  updateBy?: string;
  remark?: string;
}

export interface PartnerForm {
  id?: number | null;
  partnerName?: string | null;
  contactPerson?: string | null;
  contactPhone?: string | null;
  profitRatio?: string | null;
  account?: string | null;
  password?: string | null;
  createTime?: string | null;
  updateTime?: string | null;
  createBy?: string | null;
  updateBy?: string | null;
  remark?: string | null;
}
